package com.sc.nft.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dao.AdminProductStockDetailDao;
import com.sc.nft.entity.AdminProductStockDetail;
import com.sc.nft.entity.vo.AdminProductStockDetailVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.service.AdminProductStockDetailService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * 后台调整商品库存记录表服务接口实现
 *
 * @author Tangzehui
 * @since 2023-11-30 10:19:14
 * @description 
 */
@Slf4j
@RequiredArgsConstructor
@Service
public class AdminProductStockDetailServiceImpl implements AdminProductStockDetailService {
    private final AdminProductStockDetailDao adminProductStockDetailDao;

    @Override
    public Page<AdminProductStockDetailVO> pageAdmin(String firstTitle, Boolean isAdd, Date startTime, Date endTime, int pageSize, int pageNo) {
        return adminProductStockDetailDao.pageAdmin(firstTitle,isAdd,startTime,endTime,pageSize,pageNo);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void add(AdminProductStockDetail adminProductStockDetail) {
        adminProductStockDetail.insert();
    }
}